package com.kestrel.space.core.service;

import com.kestrel.space.common.model.User;
import com.kestrel.space.common.utils.LargePage;
import com.kestrel.space.core.model.MyFile;
import com.kestrel.space.core.query.MyFileQuery;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @Author: kestrel
 * @Version:1.0
 * @Date: 2024/8/21
 */
public interface FileService {
    List<MyFile> listContent(MyFileQuery query, LargePage page);

    String saveOrUpdate(MyFile myFile);

    String batchSaveOrUpdate(List<MyFile> fileList);

    String uploadFile(MultipartFile file, String type, String osUrl, User user, String md5);

    String deleteFile(Long id);

    String synchronizationFile(Long id, User user);

    String downloadFile(Long id, HttpServletRequest request, HttpServletResponse response);

    MyFile selectFileById(Long id);

    List<MyFile> listOrganizationFiles(MyFileQuery query);

    String allocate(Long fileId, Long organizationId, boolean stage);

    List<Long> listMyFilesInOrg(User user, Long organizationId);

    String previewFile(Long id);
}
